<template>
  <div class="ma-content-block lg:flex justify-between p-4">
    <!-- CRUD 组件 -->
    <ma-crud :options="options" :columns="columns" ref="crudRef">
    </ma-crud>
  </div>
</template>
<script setup>
import { ref, reactive } from 'vue'
import addressChannel from '@/api/logistics/addressChannel'
import { Message } from '@arco-design/web-vue'
import tool from '@/utils/tool'
import * as common from '@/utils/common'
import dictHelp from "@/utils/dicthelp.js";
const crudRef = ref()




const options = reactive({
  id: 'address_channel',
  rowSelection: {
    showCheckedAll: true
  },
  pk: 'id',
  operationColumn: true,
  operationColumnWidth: 160,
  formOption: {
    viewType: 'drawer',
    width: 600
  },
  api: addressChannel.getList,
  add: {
    show: true,
    api: addressChannel.save,
    auth: ['logistics:addressChannel:save']
  },
  edit: {
    show: true,
    api: addressChannel.update,
    auth: ['logistics:addressChannel:update']
  },
  delete: {
    show: true,
    api: addressChannel.deletes,
    auth: ['logistics:addressChannel:delete']
  }
})

const columns = reactive([
  {
    title: "主键",
    dataIndex: "id",
    formType: "input",
    addDisplay: false,
    editDisplay: false,
    hide: true,
    commonRules: {
      required: true,
      message: "请输入主键"
    }
  },
  {
    title: "地址库",
    dataIndex: "address_id",
    formType: "select",
    search: true,
    dict:dictHelp.addressLibDetail,
    commonRules: {
      required: true,
      message: "请输入地址库ID"
    }
  },
  {
    title: "打单渠道",
    dataIndex: "channel_ids",
    formType: "tree-select",
    search: true,
    dict: {url: 'logistics/supplier/channel?type=6', translation: true,},
    multiple:true,
  }
])
</script>
<script> export default { name: 'logistics:addressChannel' } </script>